package de.tc.stammdatenverwaltung.gui;

import de.tc.stammdatenverwaltung.functions.commonFunctions;
import java.awt.event.KeyEvent;
import java.text.SimpleDateFormat;
import java.util.Date;

public class FilterDialog extends javax.swing.JDialog {

    /** Creates new form Filter */
    public FilterDialog(java.awt.Frame parent, boolean modal) {
        super(parent, modal);
        initComponents();
        jTextField1.requestFocus();
        this.setTitle("Datensätze filtern");
        jLabel2.setText(  " " + Main.jTable1.getRowCount() );
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
  private void initComponents() {

    jPanel3 = new javax.swing.JPanel();
    jTextField1 = new javax.swing.JTextField();
    jButton6 = new javax.swing.JButton();
    jLabel3 = new javax.swing.JLabel();
    jButton8 = new javax.swing.JButton();
    jPanel4 = new javax.swing.JPanel();
    jLabel4 = new javax.swing.JLabel();
    jButton1 = new javax.swing.JButton();
    jButton2 = new javax.swing.JButton();
    jButton3 = new javax.swing.JButton();
    jPanel1 = new javax.swing.JPanel();
    jCheckBox1 = new javax.swing.JCheckBox();
    jCheckBox2 = new javax.swing.JCheckBox();
    jCheckBox3 = new javax.swing.JCheckBox();
    jCheckBox4 = new javax.swing.JCheckBox();
    jCheckBox5 = new javax.swing.JCheckBox();
    jCheckBox28 = new javax.swing.JCheckBox();
    jPanel2 = new javax.swing.JPanel();
    jCheckBox7 = new javax.swing.JCheckBox();
    jCheckBox8 = new javax.swing.JCheckBox();
    jCheckBox9 = new javax.swing.JCheckBox();
    jCheckBox10 = new javax.swing.JCheckBox();
    jCheckBox11 = new javax.swing.JCheckBox();
    jCheckBox12 = new javax.swing.JCheckBox();
    jCheckBox13 = new javax.swing.JCheckBox();
    jPanel5 = new javax.swing.JPanel();
    jCheckBox18 = new javax.swing.JCheckBox();
    jCheckBox17 = new javax.swing.JCheckBox();
    jCheckBox16 = new javax.swing.JCheckBox();
    jPanel7 = new javax.swing.JPanel();
    jCheckBox29 = new javax.swing.JCheckBox();
    jCheckBox19 = new javax.swing.JCheckBox();
    jCheckBox20 = new javax.swing.JCheckBox();
    jCheckBox21 = new javax.swing.JCheckBox();
    jCheckBox22 = new javax.swing.JCheckBox();
    jPanel8 = new javax.swing.JPanel();
    jCheckBox6 = new javax.swing.JCheckBox();
    jCheckBox30 = new javax.swing.JCheckBox();
    jCheckBox14 = new javax.swing.JCheckBox();
    jCheckBox15 = new javax.swing.JCheckBox();
    jLabel1 = new javax.swing.JLabel();
    jLabel2 = new javax.swing.JLabel();
    jPanel6 = new javax.swing.JPanel();
    jLabel5 = new javax.swing.JLabel();
    jCheckBox23 = new javax.swing.JCheckBox();
    jCheckBox24 = new javax.swing.JCheckBox();
    jCheckBox25 = new javax.swing.JCheckBox();
    jCheckBox26 = new javax.swing.JCheckBox();
    jCheckBox27 = new javax.swing.JCheckBox();

    setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

    jPanel3.setBorder(javax.swing.BorderFactory.createEtchedBorder());

    jTextField1.addKeyListener(new java.awt.event.KeyAdapter() {
      public void keyPressed(java.awt.event.KeyEvent evt) {
        jTextField1KeyPressed(evt);
      }
    });

    jButton6.setText("Anwenden");
    jButton6.addActionListener(new java.awt.event.ActionListener() {
      public void actionPerformed(java.awt.event.ActionEvent evt) {
        jButton6ActionPerformed(evt);
      }
    });

    jLabel3.setFont(new java.awt.Font("Dialog", 1, 18));
    jLabel3.setText("Filter");

    jButton8.setText("Rücksetzen");
    jButton8.addActionListener(new java.awt.event.ActionListener() {
      public void actionPerformed(java.awt.event.ActionEvent evt) {
        jButton8ActionPerformed(evt);
      }
    });

    jPanel4.setBorder(javax.swing.BorderFactory.createEtchedBorder());

    jLabel4.setText("Felder");

    jButton1.setText("setze alle");
    jButton1.addActionListener(new java.awt.event.ActionListener() {
      public void actionPerformed(java.awt.event.ActionEvent evt) {
        jButton1ActionPerformed(evt);
      }
    });

    jButton2.setText("entferne alle");
    jButton2.addActionListener(new java.awt.event.ActionListener() {
      public void actionPerformed(java.awt.event.ActionEvent evt) {
        jButton2ActionPerformed(evt);
      }
    });

    jButton3.setText("setze Standard");
    jButton3.addActionListener(new java.awt.event.ActionListener() {
      public void actionPerformed(java.awt.event.ActionEvent evt) {
        jButton3ActionPerformed(evt);
      }
    });

    jPanel1.setBorder(javax.swing.BorderFactory.createEtchedBorder());

    jCheckBox1.setText("Titel");

    jCheckBox2.setSelected(true);
    jCheckBox2.setText("Vorname");

    jCheckBox3.setText("2. Name");

    jCheckBox4.setSelected(true);
    jCheckBox4.setText("Nachname");

    jCheckBox5.setSelected(true);
    jCheckBox5.setText("Spitzname");

    jCheckBox28.setText("Anrede");

    javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
    jPanel1.setLayout(jPanel1Layout);
    jPanel1Layout.setHorizontalGroup(
      jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(jPanel1Layout.createSequentialGroup()
        .addContainerGap()
        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
          .addGroup(jPanel1Layout.createSequentialGroup()
            .addComponent(jCheckBox3)
            .addGap(12, 12, 12))
          .addGroup(jPanel1Layout.createSequentialGroup()
            .addComponent(jCheckBox28)
            .addGap(18, 18, 18)))
        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
          .addComponent(jCheckBox4)
          .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
            .addComponent(jCheckBox1)
            .addGap(43, 43, 43)))
        .addGap(34, 34, 34)
        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
          .addComponent(jCheckBox2)
          .addComponent(jCheckBox5))
        .addContainerGap(74, Short.MAX_VALUE))
    );
    jPanel1Layout.setVerticalGroup(
      jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
        .addContainerGap(12, Short.MAX_VALUE)
        .addComponent(jCheckBox2)
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addComponent(jCheckBox5)
        .addContainerGap())
      .addGroup(jPanel1Layout.createSequentialGroup()
        .addContainerGap()
        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(jCheckBox1)
          .addComponent(jCheckBox28))
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(jCheckBox3)
          .addComponent(jCheckBox4))
        .addContainerGap(12, Short.MAX_VALUE))
    );

    jPanel2.setBorder(javax.swing.BorderFactory.createEtchedBorder());

    jCheckBox7.setText("Anschrift");

    jCheckBox8.setSelected(true);
    jCheckBox8.setText("PLZ + Ort");

    jCheckBox9.setSelected(true);
    jCheckBox9.setText("Telefon");

    jCheckBox10.setSelected(true);
    jCheckBox10.setText("Fax");

    jCheckBox11.setSelected(true);
    jCheckBox11.setText("Mobil");

    jCheckBox12.setSelected(true);
    jCheckBox12.setText("E-Mail 1");

    jCheckBox13.setSelected(true);
    jCheckBox13.setText("E-Mail 2");

    javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
    jPanel2.setLayout(jPanel2Layout);
    jPanel2Layout.setHorizontalGroup(
      jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(jPanel2Layout.createSequentialGroup()
        .addContainerGap()
        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
          .addComponent(jCheckBox7)
          .addComponent(jCheckBox10))
        .addGap(18, 18, 18)
        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
          .addComponent(jCheckBox8)
          .addComponent(jCheckBox11))
        .addGap(18, 18, 18)
        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
          .addGroup(jPanel2Layout.createSequentialGroup()
            .addComponent(jCheckBox12)
            .addGap(18, 18, 18)
            .addComponent(jCheckBox13))
          .addComponent(jCheckBox9))
        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
    );
    jPanel2Layout.setVerticalGroup(
      jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(jPanel2Layout.createSequentialGroup()
        .addContainerGap()
        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(jCheckBox7)
          .addComponent(jCheckBox8)
          .addComponent(jCheckBox9))
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
          .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
            .addComponent(jCheckBox11)
            .addComponent(jCheckBox12)
            .addComponent(jCheckBox13))
          .addComponent(jCheckBox10))
        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
    );

    jPanel5.setBorder(javax.swing.BorderFactory.createEtchedBorder());

    jCheckBox18.setText("Beruf");

    jCheckBox17.setText("Rang");

    jCheckBox16.setSelected(true);
    jCheckBox16.setText("Firma");

    javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
    jPanel5.setLayout(jPanel5Layout);
    jPanel5Layout.setHorizontalGroup(
      jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(jPanel5Layout.createSequentialGroup()
        .addContainerGap()
        .addComponent(jCheckBox16)
        .addGap(18, 18, 18)
        .addComponent(jCheckBox17)
        .addGap(18, 18, 18)
        .addComponent(jCheckBox18)
        .addContainerGap(180, Short.MAX_VALUE))
    );
    jPanel5Layout.setVerticalGroup(
      jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(jPanel5Layout.createSequentialGroup()
        .addContainerGap()
        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(jCheckBox16)
          .addComponent(jCheckBox17)
          .addComponent(jCheckBox18))
        .addContainerGap(35, Short.MAX_VALUE))
    );

    jPanel7.setBorder(javax.swing.BorderFactory.createEtchedBorder());

    jCheckBox29.setText("Fa. Anschrift");

    jCheckBox19.setText("Fa. PLZ + Ort");

    jCheckBox20.setText("Fa. Telefon");

    jCheckBox21.setText("Fa. Fax");

    jCheckBox22.setText("Fa. E-Mail");

    javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
    jPanel7.setLayout(jPanel7Layout);
    jPanel7Layout.setHorizontalGroup(
      jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(jPanel7Layout.createSequentialGroup()
        .addContainerGap()
        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
          .addComponent(jCheckBox29)
          .addComponent(jCheckBox21))
        .addGap(18, 18, 18)
        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
          .addGroup(jPanel7Layout.createSequentialGroup()
            .addComponent(jCheckBox19)
            .addGap(18, 18, 18)
            .addComponent(jCheckBox20))
          .addComponent(jCheckBox22))
        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
    );
    jPanel7Layout.setVerticalGroup(
      jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(jPanel7Layout.createSequentialGroup()
        .addContainerGap()
        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(jCheckBox29)
          .addComponent(jCheckBox19)
          .addComponent(jCheckBox20))
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(jCheckBox21)
          .addComponent(jCheckBox22))
        .addContainerGap(12, Short.MAX_VALUE))
    );

    jPanel8.setBorder(javax.swing.BorderFactory.createEtchedBorder());

    jCheckBox6.setSelected(true);
    jCheckBox6.setText("Geburtstag");

    jCheckBox30.setSelected(true);
    jCheckBox30.setText("Tag");

    jCheckBox14.setSelected(true);
    jCheckBox14.setText("Abitur");

    jCheckBox15.setSelected(true);
    jCheckBox15.setText("Ämter");

    javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);
    jPanel8.setLayout(jPanel8Layout);
    jPanel8Layout.setHorizontalGroup(
      jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(jPanel8Layout.createSequentialGroup()
        .addContainerGap()
        .addComponent(jCheckBox6)
        .addGap(18, 18, 18)
        .addComponent(jCheckBox30)
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
        .addComponent(jCheckBox14)
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addComponent(jCheckBox15)
        .addContainerGap(87, Short.MAX_VALUE))
    );
    jPanel8Layout.setVerticalGroup(
      jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(jPanel8Layout.createSequentialGroup()
        .addContainerGap()
        .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(jCheckBox6)
          .addComponent(jCheckBox30)
          .addComponent(jCheckBox14)
          .addComponent(jCheckBox15))
        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
    );

    jLabel1.setText("Gefunden:");

    jLabel2.setText("jLabel2");

    javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
    jPanel4.setLayout(jPanel4Layout);
    jPanel4Layout.setHorizontalGroup(
      jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(jPanel4Layout.createSequentialGroup()
        .addGap(12, 12, 12)
        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
          .addComponent(jLabel4)
          .addGroup(jPanel4Layout.createSequentialGroup()
            .addComponent(jButton1)
            .addGap(18, 18, 18)
            .addComponent(jButton3)
            .addGap(18, 18, 18)
            .addComponent(jButton2)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
            .addComponent(jLabel1)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(jLabel2)))
        .addContainerGap(288, Short.MAX_VALUE))
      .addGroup(jPanel4Layout.createSequentialGroup()
        .addContainerGap()
        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
          .addComponent(jPanel8, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
          .addComponent(jPanel2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
          .addComponent(jPanel1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        .addGap(18, 18, 18)
        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
          .addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
          .addComponent(jPanel7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
    );
    jPanel4Layout.setVerticalGroup(
      jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup()
        .addComponent(jLabel4)
        .addGap(6, 6, 6)
        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(jButton1)
          .addComponent(jButton3)
          .addComponent(jButton2)
          .addComponent(jLabel1)
          .addComponent(jLabel2))
        .addGap(18, 18, 18)
        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
          .addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
          .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
          .addComponent(jPanel7, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
          .addComponent(jPanel2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addComponent(jPanel8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        .addContainerGap())
    );

    jPanel6.setBorder(javax.swing.BorderFactory.createEtchedBorder());

    jLabel5.setText("Vereine");

    jCheckBox23.setText("Forum Thomanum");

    jCheckBox24.setText("Förderkreis Thomanerchor");

    jCheckBox25.setText("Thomanerbund");

    jCheckBox26.setText("Freund des Chores");

    jCheckBox27.setText("Alumnus");

    javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
    jPanel6.setLayout(jPanel6Layout);
    jPanel6Layout.setHorizontalGroup(
      jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(jPanel6Layout.createSequentialGroup()
        .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
          .addComponent(jLabel5)
          .addGroup(jPanel6Layout.createSequentialGroup()
            .addContainerGap()
            .addComponent(jCheckBox23)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(jCheckBox24)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(jCheckBox25)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(jCheckBox26)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(jCheckBox27)))
        .addContainerGap(112, Short.MAX_VALUE))
    );
    jPanel6Layout.setVerticalGroup(
      jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(jPanel6Layout.createSequentialGroup()
        .addComponent(jLabel5)
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(jCheckBox23)
          .addComponent(jCheckBox24)
          .addComponent(jCheckBox25)
          .addComponent(jCheckBox26)
          .addComponent(jCheckBox27))
        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
    );

    javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
    jPanel3.setLayout(jPanel3Layout);
    jPanel3Layout.setHorizontalGroup(
      jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(jPanel3Layout.createSequentialGroup()
        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
          .addComponent(jLabel3)
          .addGroup(jPanel3Layout.createSequentialGroup()
            .addContainerGap()
            .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addComponent(jPanel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
              .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
              .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                .addComponent(jTextField1, javax.swing.GroupLayout.DEFAULT_SIZE, 587, Short.MAX_VALUE)
                .addGap(18, 18, 18)
                .addComponent(jButton6, javax.swing.GroupLayout.PREFERRED_SIZE, 122, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jButton8)
                .addGap(2, 2, 2)))))
        .addContainerGap())
    );
    jPanel3Layout.setVerticalGroup(
      jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(jPanel3Layout.createSequentialGroup()
        .addComponent(jLabel3)
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
          .addComponent(jButton8)
          .addComponent(jButton6))
        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
    );

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
      layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(layout.createSequentialGroup()
        .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
    );
    layout.setVerticalGroup(
      layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(layout.createSequentialGroup()
        .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
    );

    pack();
  }// </editor-fold>//GEN-END:initComponents

    private void jButton6ActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_jButton6ActionPerformed
    {//GEN-HEADEREND:event_jButton6ActionPerformed
      //Suchen
      jTextField1.setText(jTextField1.getText().toLowerCase());

      String filterSQL = Main.selectSQL + " where (";
      String where = "";
      if (jCheckBox1.isSelected())
        where += " (s.TITEL containing '" + commonFunctions.sqlSichern(jTextField1.getText()) + "' ) ";

      if (jCheckBox2.isSelected())
      {
        if ( where.length() > 1 )
          where += " or ";
        where += " (s.VNAME containing '" + commonFunctions.sqlSichern(jTextField1.getText()) + "' ) ";
      }
      if (jCheckBox3.isSelected())
      {
        if ( where.length() > 1 )
          where += " or ";
        where += " (s.NAME2 containing '" + commonFunctions.sqlSichern(jTextField1.getText()) + "' ) ";
      }
      if (jCheckBox4.isSelected())
      {
        if ( where.length() > 1 )
          where += " or ";
        where += " (s.NNAME containing '" + commonFunctions.sqlSichern(jTextField1.getText()) + "' ) ";
      }
      if (jCheckBox5.isSelected())
      {
        if ( where.length() > 1 )
          where += " or ";
        where += " (s.NICK containing '" + commonFunctions.sqlSichern(jTextField1.getText()) + "' ) ";
      }
      if (jCheckBox6.isSelected())
      {
        String[] ar = commonFunctions.bdayFromString(jTextField1.getText());
        if ( ar != null)
        {
          if ( where.length() > 1 )
            where += " or ";

          if (ar.length == 1)
            where += " (GEBURTSTAG = '" + ar[0] + "' ) ";
          else if (ar.length == 2)
            where += " (GEBURTSTAG between '" + ar[0] + "' and '" + ar[1] + "') ";
        }
      }
      if (jCheckBox7.isSelected())
      {
        if ( where.length() > 1 )
          where += " or ";
        where += " (s.ANSCHRIFT containing '" + commonFunctions.sqlSichern(jTextField1.getText()) + "' ) ";
      }
      if (jCheckBox8.isSelected())
      {
        if ( where.length() > 1 )
          where += " or ";
        where += " (s.PLZ_ORT containing '" + commonFunctions.sqlSichern(jTextField1.getText()) + "' ) ";
      }
      if (jCheckBox9.isSelected())
      {
        if ( where.length() > 1 )
          where += " or ";
        where += " (LOWER(s.TEL) containing '" + commonFunctions.sqlSichern(jTextField1.getText()) + "' ) ";
      }
      if (jCheckBox10.isSelected())
      {
        if ( where.length() > 1 )
          where += " or ";
        where += " (LOWER(s.FAX) containing '" + commonFunctions.sqlSichern(jTextField1.getText()) + "' ) ";
      }
      if (jCheckBox11.isSelected())
      {
        if ( where.length() > 1 )
          where += " or ";
        where += " (LOWER(s.MOBIL) = '" + commonFunctions.sqlSichern(jTextField1.getText()) + "' ) ";
      }
      if (jCheckBox12.isSelected())
      {
        if ( where.length() > 1 )
          where += " or ";
        where += " (LOWER(s.MAIL1) containing '" + commonFunctions.sqlSichern(jTextField1.getText()) + "' ) ";
      }
      if (jCheckBox13.isSelected())
      {
        if ( where.length() > 1 )
          where += " or ";
        where += " (LOWER(s.MAIL2) containing '" + commonFunctions.sqlSichern(jTextField1.getText()) + "' ) ";
      }

      if (jCheckBox14.isSelected())
      {
        try
        {
          SimpleDateFormat sdf = new SimpleDateFormat( "yyyy" );
          Date ad = sdf.parse( jTextField1.getText() );

          //sdf = new SimpleDateFormat( "yyyy" );
          if ( where.length() > 1 )
            where += " or ";
          where += " (ABITUR = '01.01." + sdf.format(ad) + "' ) ";
        }
        catch (Exception e)
        {
          System.out.println("Ignoriere Abitur, kein Datum uebergeben ...");
        }
      }
      if (jCheckBox15.isSelected())
      {
        if ( where.length() > 1 )
          where += " or ";
        where += " (s.AEMTER containing '" + commonFunctions.sqlSichern(jTextField1.getText()) + "' ) ";
      }
      if (jCheckBox16.isSelected())
      {
        if ( where.length() > 1 )
          where += " or ";
        where += " (s.FIRMA containing '" + commonFunctions.sqlSichern(jTextField1.getText()) + "' ) ";
      }
      if (jCheckBox17.isSelected())
      {
        if ( where.length() > 1 )
          where += " or ";
        where += " (s.RANG containing '" + commonFunctions.sqlSichern(jTextField1.getText()) + "' ) ";
      }
      if (jCheckBox18.isSelected())
      {
        if ( where.length() > 1 )
          where += " or ";
        where += " (s.BERUF containing '" + commonFunctions.sqlSichern(jTextField1.getText()) + "' ) ";
      }
      if (jCheckBox19.isSelected())
      {
        if ( where.length() > 1 )
          where += " or ";
        where += " (s.F_PLZ_ORT containing '" + commonFunctions.sqlSichern(jTextField1.getText()) + "' ) ";
      }
      if (jCheckBox20.isSelected())
      {
        if ( where.length() > 1 )
          where += " or ";
        where += " (LOWER(s.F_TEL) containing '" + commonFunctions.sqlSichern(jTextField1.getText()) + "' ) ";
      }
      if (jCheckBox21.isSelected())
      {
        if ( where.length() > 1 )
          where += " or ";
        where += " (LOWER(s.F_FAX) containing '" + commonFunctions.sqlSichern(jTextField1.getText()) + "' ) ";
      }
      if (jCheckBox22.isSelected())
      {
        if ( where.length() > 1 )
          where += " or ";
        where += " (LOWER(s.F_MAIL) containing '" + commonFunctions.sqlSichern(jTextField1.getText()) + "' ) ";
      }
      if (jCheckBox28.isSelected())
      {
        if ( where.length() > 1 )
          where += " or ";
        where += " (LOWER(s.ANREDE) = '" + commonFunctions.sqlSichern(jTextField1.getText()) + "' ) ";
      }
      if (jCheckBox20.isSelected())
      {
        if ( where.length() > 1 )
          where += " or ";
        where += " (s.F_ANSCHRIFT containing '" + commonFunctions.sqlSichern(jTextField1.getText()) + "' ) ";
      }
      if (jCheckBox30.isSelected())
      {
        if ( where.length() > 1 )
          where += " or ";
        where += " (s.TAGFIELD containing '" + commonFunctions.sqlSichern(jTextField1.getText()) + "' ) ";
      }

      if (jCheckBox23.isSelected())
      {
        if ( where.length() > 1 )
          where += " or ";
        where += " ( F_BIN_AND(s.VEREIN, 1 ) = 1 ) ";
      }
      if (jCheckBox24.isSelected())
      {
        if ( where.length() > 1 )
          where += " or ";
        where += " ( F_BIN_AND(s.VEREIN, 4 ) = 4 ) ";
      }
      if (jCheckBox25.isSelected())
      {
        if ( where.length() > 1 )
          where += " or ";
        where += " ( F_BIN_AND(s.VEREIN, 2 ) = 2 ) ";
      }
      if (jCheckBox26.isSelected())
      {
        if ( where.length() > 1 )
          where += " or ";
        where += " ( F_BIN_AND(s.VEREIN, 8 ) = 8 ) ";
      }
      if (jCheckBox27.isSelected())
      {
        if ( where.length() > 1 )
          where += " or ";
        where += " ( F_BIN_AND(s.VEREIN, 16 ) = 16 ) ";
      }

      if (where.length() < 1)
        where = "1 = 1"; //fallback, alles zeigen

      where += ")";

      filterSQL += where;

      System.out.println(filterSQL);
      commonFunctions.load_query_to_table(filterSQL, Main.jTable1, Main.mtm);

      jLabel2.setText(  " " + Main.jTable1.getRowCount() );
}//GEN-LAST:event_jButton6ActionPerformed

    private void jButton8ActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_jButton8ActionPerformed
    {//GEN-HEADEREND:event_jButton8ActionPerformed
      commonFunctions.load_query_to_table(Main.selectSQL, Main.jTable1, Main.mtm);
    }//GEN-LAST:event_jButton8ActionPerformed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_jButton1ActionPerformed
    {//GEN-HEADEREND:event_jButton1ActionPerformed
      jCheckBox1.setSelected(true);
      jCheckBox2.setSelected(true);
      jCheckBox3.setSelected(true);
      jCheckBox4.setSelected(true);
      jCheckBox5.setSelected(true);
      jCheckBox6.setSelected(true);
      jCheckBox7.setSelected(true);
      jCheckBox8.setSelected(true);
      jCheckBox9.setSelected(true);
      jCheckBox10.setSelected(true);
      jCheckBox11.setSelected(true);
      jCheckBox12.setSelected(true);
      jCheckBox13.setSelected(true);
      jCheckBox14.setSelected(true);
      jCheckBox15.setSelected(true);
      jCheckBox16.setSelected(true);
      jCheckBox17.setSelected(true);
      jCheckBox18.setSelected(true);
      jCheckBox19.setSelected(true);
      jCheckBox20.setSelected(true);
      jCheckBox21.setSelected(true);
      jCheckBox22.setSelected(true);
      jCheckBox28.setSelected(true);
      jCheckBox29.setSelected(true);
      jCheckBox30.setSelected(true);
    }//GEN-LAST:event_jButton1ActionPerformed

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_jButton2ActionPerformed
    {//GEN-HEADEREND:event_jButton2ActionPerformed
      jCheckBox1.setSelected(false);
      jCheckBox2.setSelected(false);
      jCheckBox3.setSelected(false);
      jCheckBox4.setSelected(false);
      jCheckBox5.setSelected(false);
      jCheckBox6.setSelected(false);
      jCheckBox7.setSelected(false);
      jCheckBox8.setSelected(false);
      jCheckBox9.setSelected(false);
      jCheckBox10.setSelected(false);
      jCheckBox11.setSelected(false);
      jCheckBox12.setSelected(false);
      jCheckBox13.setSelected(false);
      jCheckBox14.setSelected(false);
      jCheckBox15.setSelected(false);
      jCheckBox16.setSelected(false);
      jCheckBox17.setSelected(false);
      jCheckBox18.setSelected(false);
      jCheckBox19.setSelected(false);
      jCheckBox20.setSelected(false);
      jCheckBox21.setSelected(false);
      jCheckBox22.setSelected(false);
      jCheckBox28.setSelected(false);
      jCheckBox29.setSelected(false);
      jCheckBox30.setSelected(false);
    }//GEN-LAST:event_jButton2ActionPerformed

    private void jButton3ActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_jButton3ActionPerformed
    {//GEN-HEADEREND:event_jButton3ActionPerformed
      jCheckBox1.setSelected(false);
      jCheckBox2.setSelected(false);
      jCheckBox3.setSelected(false);
      jCheckBox4.setSelected(true);
      jCheckBox5.setSelected(true);
      jCheckBox6.setSelected(true);
      jCheckBox7.setSelected(true);
      jCheckBox8.setSelected(true);
      jCheckBox9.setSelected(true);
      jCheckBox10.setSelected(true);
      jCheckBox11.setSelected(true);
      jCheckBox12.setSelected(true);
      jCheckBox13.setSelected(true);
      jCheckBox14.setSelected(true);
      jCheckBox15.setSelected(true);
      jCheckBox16.setSelected(true);
      jCheckBox17.setSelected(false);
      jCheckBox18.setSelected(false);
      jCheckBox19.setSelected(false);
      jCheckBox20.setSelected(false);
      jCheckBox21.setSelected(false);
      jCheckBox22.setSelected(false);
      jCheckBox28.setSelected(false);
      jCheckBox29.setSelected(false);
      jCheckBox30.setSelected(true);
    }//GEN-LAST:event_jButton3ActionPerformed

    private void jTextField1KeyPressed(java.awt.event.KeyEvent evt)//GEN-FIRST:event_jTextField1KeyPressed
    {//GEN-HEADEREND:event_jTextField1KeyPressed
      if (evt.getKeyCode() == KeyEvent.VK_ENTER)
        jButton6ActionPerformed(null);
      if (evt.getKeyCode() == KeyEvent.VK_ESCAPE)
        this.dispose();
    }//GEN-LAST:event_jTextField1KeyPressed

  // Variables declaration - do not modify//GEN-BEGIN:variables
  private javax.swing.JButton jButton1;
  private javax.swing.JButton jButton2;
  private javax.swing.JButton jButton3;
  private javax.swing.JButton jButton6;
  private javax.swing.JButton jButton8;
  private javax.swing.JCheckBox jCheckBox1;
  private javax.swing.JCheckBox jCheckBox10;
  private javax.swing.JCheckBox jCheckBox11;
  private javax.swing.JCheckBox jCheckBox12;
  private javax.swing.JCheckBox jCheckBox13;
  private javax.swing.JCheckBox jCheckBox14;
  private javax.swing.JCheckBox jCheckBox15;
  private javax.swing.JCheckBox jCheckBox16;
  private javax.swing.JCheckBox jCheckBox17;
  private javax.swing.JCheckBox jCheckBox18;
  private javax.swing.JCheckBox jCheckBox19;
  private javax.swing.JCheckBox jCheckBox2;
  private javax.swing.JCheckBox jCheckBox20;
  private javax.swing.JCheckBox jCheckBox21;
  private javax.swing.JCheckBox jCheckBox22;
  private javax.swing.JCheckBox jCheckBox23;
  private javax.swing.JCheckBox jCheckBox24;
  private javax.swing.JCheckBox jCheckBox25;
  private javax.swing.JCheckBox jCheckBox26;
  private javax.swing.JCheckBox jCheckBox27;
  private javax.swing.JCheckBox jCheckBox28;
  private javax.swing.JCheckBox jCheckBox29;
  private javax.swing.JCheckBox jCheckBox3;
  private javax.swing.JCheckBox jCheckBox30;
  private javax.swing.JCheckBox jCheckBox4;
  private javax.swing.JCheckBox jCheckBox5;
  private javax.swing.JCheckBox jCheckBox6;
  private javax.swing.JCheckBox jCheckBox7;
  private javax.swing.JCheckBox jCheckBox8;
  private javax.swing.JCheckBox jCheckBox9;
  private javax.swing.JLabel jLabel1;
  private javax.swing.JLabel jLabel2;
  private javax.swing.JLabel jLabel3;
  private javax.swing.JLabel jLabel4;
  private javax.swing.JLabel jLabel5;
  private javax.swing.JPanel jPanel1;
  private javax.swing.JPanel jPanel2;
  private javax.swing.JPanel jPanel3;
  private javax.swing.JPanel jPanel4;
  private javax.swing.JPanel jPanel5;
  private javax.swing.JPanel jPanel6;
  private javax.swing.JPanel jPanel7;
  private javax.swing.JPanel jPanel8;
  private javax.swing.JTextField jTextField1;
  // End of variables declaration//GEN-END:variables

}
